{include="header"}

{if condition="$fsc->agente"}
<script type="text/javascript">
   $(document).ready(function() {
      $("#b_delete_agente").click(function(event) {
         event.preventDefault();
         if( confirm("¿Realmente desea eliminar el agente?") )
            window.location.href = '{$fsc->ppage->url()}&delete={$fsc->agente->codagente}';
      });
   });
</script>

<div class="container-fluid">
   <div class="row">
      <div class="col-lg-2 col-md-3 col-sm-3">
         <div class="list-group">
            <a id="b_generales" href="{$fsc->url()}" class="list-group-item active">
               <span class="glyphicon glyphicon-dashboard"></span> &nbsp; Datos generales
            </a>
            {loop="$fsc->extensions"}
               {if condition="$value->type=='button'"}
               <a id="b_{$value->from}" href="index.php?page={$value->from}&codagente={$fsc->agente->codagente}" class="list-group-item">
                  <span class="glyphicon glyphicon-list"></span> &nbsp; {$value->text}
               </a>
               {/if}
            {/loop}
         </div>
      </div>
      
      <div class="col-lg-10 col-md-9 col-sm-9">
         <form class="form" role="form" action="{$fsc->url()}" method="post">
            <div class="panel panel-primary" id="panel_generales">
               <div class="panel-heading">
                  <h3 class="panel-title">{$fsc->agente->get_fullname()}</h3>
               </div>
               <div class="panel-body">
                  <div class="form-group col-lg-6 col-md-6 col-sm-6">
                     Nombre:
                     <input class="form-control" type="text" name="nombre" value="{$fsc->agente->nombre}" autocomplete="off"/>
                  </div>
                  <div class="form-group col-lg-6 col-md-6 col-sm-6">
                     Apellidos:
                     <input class="form-control" type="text" name="apellidos" value="{$fsc->agente->apellidos}" autocomplete="off"/>
                  </div>
                  <div class="form-group col-lg-6 col-md-6 col-sm-6">
                     {#FS_CIFNIF#}:
                     <input class="form-control" type="text" name="dnicif" value="{$fsc->agente->dnicif}" autocomplete="off"/>
                  </div>
                  <div class="form-group col-lg-6 col-md-6 col-sm-6">
                     Teléfono:
                     <input class="form-control" type="text" name="telefono" value="{$fsc->agente->telefono}" autocomplete="off"/>
                  </div>
                  <div class="form-group col-lg-9 col-md-9 col-sm-9">
                     Email:
                     <input class="form-control" type="text" name="email" value="{$fsc->agente->email}" autocomplete="off"/>
                  </div>
                  <div class="form-group col-lg-3 col-md-3 col-sm-3">
                     % Comisión:
                     <input class="form-control" type="text" name="porcomision" value="{$fsc->agente->porcomision}" autocomplete="off"/>
                  </div>
               </div>
               <div class="panel-footer" style="text-align: right;">
                  <button class="btn btn-sm btn-primary" type="submit" onclick="this.disabled=true;this.form.submit();">
                     <span class="glyphicon glyphicon-floppy-disk"></span> &nbsp; Guardar
                  </button>
               </div>
            </div>
         </form>
      </div>
   </div>
</div>
{else}
<div class="text-center">
   <img src="view/img/fuuu_face.png" alt="fuuuuu"/>
</div>
{/if}

{include="footer"}